# # 1.while第1种乘法表
# print("="*5, "while第1种乘法表", "="*5)
# i = 1
# while i <= 9:
#     j = 1
#     while j <= i:
#         print("{}*{}={:<3}".format(j, i, i*j), end=" ")
#         j += 1
#     print("")
#     i += 1
#
# # 2.while第2种乘法表
# print("\n", "="*5, "while第2种乘法表", "="*5)
# i = 9
# while i >= 1:
#     j = 1
#     while j <= i:
#         print("{}*{}={:<3}".format(j, i, i*j), end=" ")
#         j += 1
#     print("")
#     i -= 1
#
# # 3.while第3种乘法表
# print("\n", "="*5, "while第3种乘法表", "="*5)
# i = 1
# while i <= 9:
#     j = 9
#     while j >= 1:
#         if j > i:
#             print(" "*7, end=" ")
#         else:
#             print("{}*{}={:<3}".format(j, i, i*j), end=" ")
#         j -= 1
#     print("")
#     i += 1
#
# # 4.while第4种乘法表
# print("\n", "="*5, "while第4种乘法表", "="*5)
# i = 9
# while i >= 1:
#     j = 9
#     while j >= 1:
#         if j > i:
#             print(" "*7, end=" ")
#         else:
#             print("{}*{}={:<3}".format(j, i, i*j), end=" ")
#         j -= 1
#     print("")
#     i -= 1

# 5.for第1种乘法表
print("\n", "="*5, "for第1种乘法表", "="*5)
for i in range(1, 10):
    for j in range(1, i+1):
        print("{}*{}={:<3}".format(j, i, i*j), end=" ")
    print("")

# 6.for第2种乘法表
print("\n", "="*5, "for第2种乘法表", "="*5)
for i in range(9, 0, -1):
    for j in range(1, i+1):
        print("{}*{}={:<3}".format(j, i, i*j), end=" ")
    print("")

# 7.for第3种乘法表
print("\n", "="*5, "for第3种乘法表", "="*5)
for i in range(1, 10):
    for j in range(9, 0, -1):
        if j > i:
            print(" "*7, end=" ")
        else:
            print("{}*{}={:<3}".format(j, i, i*j), end=" ")
    print("")

# 8.for第4种乘法表
print("\n", "="*5, "for第4种乘法表", "="*5)
for i in range(9, 0, -1):
    for j in range(9, 0, -1):
        if j > i:
            print(" "*7, end=" ")
        else:
            print("{}*{}={:<3}".format(j, i, i*j), end=" ")
    print("")
